package com.chaopei.day03;

/**
 * @Author Corday 天涯
 * @Date 2022/3/7 9:38
 */
public class Person extends MyAbstract {
    private  double money;
    public Person(){}
// 有参构造
    public Person(int mid, String mname, String gender, double money) {
        //调用父类构造，初始化父类属性
        super(mid, mname, gender);
        this.money = money;
    }

    @Override
    public String speak() {
        //调用父类的公共方法，自己特有的属性
        return "姓名："+getMname()+" 性别："+getGender()+" 财富："+this.money;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }
}
